home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7322 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: newshost.lanl.gov!tanmoy
  2. From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: a pointer problem
  5. Date: 16 Feb 1996 16:03:21 GMT
  6. Organization: Los Alamos National Laboratory
  7. Distribution: world
  8. Message-ID: <TANMOY.96Feb16090321@qcd.lanl.gov>
  9. References: <4errk0$4c3@srvr1.engin.umich.edu> <31120AB7.1C44@cmt.lpr.mail.carel.fi>
  10.     <4et96h$k84@sparcserver.lrz-muenchen.de>
  11.     <4g1a9l$l5@mailhub.scitec.com.au>
  12. NNTP-Posting-Host: qcd.lanl.gov
  13. Mime-Version: 1.0
  14. Content-Type: text
  15. In-reply-to: ramsesy@rd.scitec.com.au's message of 16 Feb 1996 07:04:21 GMT
  16.  
  17. In article <4g1a9l$l5@mailhub.scitec.com.au> ramsesy@rd.scitec.com.au
  18. (Ramses Youhana) writes: 
  19. <snip>
  20.    It is dangerous to rely on the compiler to do initialisation of static
  21.    and global variables in embedded systems.  This is usually the case when
  22.    you write your own boot code and don't include the appropriate routine(s)
  23.    which read the data out of the appropriate section (sometimes called the
  24.    IDATA or INITDATA section) and copies to the appropriate RAM locations
  25.    to initialise your variables.
  26.  
  27. To the extent you can trust your compiler to be ANSI C, you can trust
  28. it to do the initialization: embedded systems or hosted environment is
  29. immaterial in this context.
  30.  
  31.    I always find it better (and safer) design to perform my own initialisations
  32.    in an initialisation function.
  33.  
  34. You may also find it safer to write i = i + 1 instead of i++: it makes
  35. not the slightest difference.
  36.  
  37. Cheers
  38. Tanmoy
  39. --
  40. tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
  41. Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
  42. Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
  43. <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
  44. internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
  45. fax: 1 (505) 665 3003   voice: 1 (505) 665 4733    [ Home: 1 (505) 662 5596 ]
  46.